﻿

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <!-- Meta information -->
    <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <!-- Title-->
    <title>
	FIMET | Conto Deposito
</title>
    <!-- Favicons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png" /><link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png" /><link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png" /><link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png" /><link rel="shortcut icon" href="../assets/img2/favicon.ico" />


    <!-- Styleswitch if  you don't chang theme , you can delete -->


    <script type="text/javascript" lang="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" lang="javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>


    
    <link href="/Styles/Bundles/Datatables/jquery-ui_themes_smoothness_1_11_4.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Datatables/dataTables.bootstrap.min_1_10_10.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Datatables/responsive.bootstrap.min_2_0_0.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Datatables/buttons.dataTables.min_1_1_0.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Datatables/jquery.dataTables.yadcf_0_8_8.css" rel="stylesheet"/>
<script src="/Scripts/Bundles/Datatables/jquery.dataTables_1_10_10.js"></script>
<script src="/Scripts/Bundles/Datatables/dataTables.bootstrap.min_1_10_10.js"></script>
<script src="/Scripts/Bundles/Datatables/dataTables.responsive.min_2_0_0.js"></script>
<script src="/Scripts/Bundles/Datatables/responsive.bootstrap.min_2_0_0.js"></script>
<script src="/Scripts/Bundles/Datatables/dataTables.select.min_1_1_0.js"></script>
<script src="/Scripts/Bundles/Datatables/dataTables.buttons.min_1_1_0.js"></script>
<script src="/Scripts/Bundles/Datatables/jquery.dataTables.yadcf_0_8_8.js"></script>
<link href="/Styles/Bundles/Formly/bootstrap.min_3_3_2.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Formly/select_0_16_0.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Formly/select2_3_4_5.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Formly/selectize.default_0_8_5.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Formly/angular-bootstrap-datetimepicker_0_3_13.css" rel="stylesheet"/>
<link href="/Styles/Bundles/Formly/bootstrap-datetimepicker.css" rel="stylesheet"/>
<script src="/Scripts/Bundles/Formly/Api-check_7_5_5.js"></script>
<script src="/Scripts/Bundles/Formly/AngularJS_1_4_4.js"></script>
<script src="/Scripts/Bundles/Formly/Formly_8_2_1.js"></script>
<script src="/Scripts/Bundles/Formly/angular-formly-templates-bootstrap_6_3_2.js"></script>
<script src="/Scripts/Bundles/Formly/mask.js"></script>
<script src="/Scripts/Bundles/Formly/ui-bootstrap-tpls.min_0_13_3.js"></script>
<script src="/Scripts/Bundles/Formly/select_0_16_0.js"></script>
<script src="/Scripts/Bundles/Formly/angular-sanitize_1_4_6.js"></script>
<script src="/Scripts/Bundles/Formly/moment_2_10_6.js"></script>
<script src="/Scripts/Bundles/Formly/moment_locale_it_2_10_6.js"></script>
<script src="/Scripts/Bundles/Formly/angular-bootstrap-datetimepicker_0_3_13.js"></script>
<script src="/Scripts/Bundles/Formly/angular-base64-upload_0_1_19.js"></script>
<script src="/Scripts/Bundles/Formly/bootstrap-datetimepicker.it.js"></script>
<script src="/Scripts/Bundles/Formly/bootstrap-datetimepicker.js"></script>


    <script type="text/javascript" lang="javascript" src="../Scripts/Formly/FormlyHelper.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Core.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.Fileupload.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.DateTimePicker.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.DataTables.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Modals.js"></script> 


        <!-- CSS Stylesheet-->
    <link type="text/css" rel="stylesheet" href="../assets/css/bootstrap/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="../assets/css/bootstrap/bootstrap-themes.css" />
    <link type="text/css" rel="stylesheet" href="../assets/css/style.css" /></head>

<body class="leftMenu nav-collapse in">
    



<div id="wrapper" class="wrapper-shadow" style="background-color:#e5e9ec;">
		<!--
		/////////////////////////////////////////////////////////////////////////
		//////////     HEADER  CONTENT     ///////////////
		//////////////////////////////////////////////////////////////////////
		-->
		<div id="header">
		
				<div class="logo-area clearfix">
						<a href="#" class="logo"></a>
				</div>
				<!-- //logo-area-->
				
				<div class="tools-bar">
						<ul class="nav navbar-nav nav-main-xs">
								<li><a href="#" class="icon-toolsbar nav-mini"><i class="fa fa-bars"></i></a></li>
						</ul>
						<ul class="nav navbar-nav navbar-right tooltip-area">
								<li><a href="#menu-right" data-toggle="tooltip" title="Right Menu" data-container="body" data-placement="left"><i class="fa fa-align-right"></i></a></li>
								<li class="hidden-xs hidden-sm"><a href="#" class="h-seperate">Help</a></li>
								<li class="dropdown">
										<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">
											<em><strong><span id="lblUserLogged">admin</span></strong></em> <i class="dropdown-icon fa fa-angle-down"></i>
										</a>
										<ul class="dropdown-menu pull-right icon-right arrow">
												<li><a href="#"><i class="fa fa-user"></i> Profile</a></li>
												<li><a href="#"><i class="fa fa-cog"></i> Setting </a></li>
												<li><a href="#"><i class="fa fa-bookmark"></i> Bookmarks</a></li>
												<li><a href="#"><i class="fa fa-money"></i> Make a Deposit</a></li>
												<li class="divider"></li>
												<li><a href="#" onclick="javascript:Logout()"><i class="fa fa-sign-out"></i> Signout </a></li>
										</ul>
										<!-- //dropdown-menu-->
								</li>
								<li class="visible-lg">
									<a href="#" class="h-seperate fullscreen" data-toggle="tooltip" title="Full Screen" data-container="body"  data-placement="left">
										<i class="fa fa-expand"></i>
									</a>
								</li>
						</ul>
				</div>
				<!-- //tools-bar-->
				
		</div>
		<!-- //header-->
		
		
		<!--
		/////////////////////////////////////////////////////////////////////////
		//////////     SLIDE LEFT CONTENT     //////////
		//////////////////////////////////////////////////////////////////////
		-->
		<!-- //nav-->
		
		
		<!--
		/////////////////////////////////////////////////////////////////////////
		//////////     TOP SEARCH CONTENT     ///////
		//////////////////////////////////////////////////////////////////////
		-->
		<!-- //widget-top-search-->
		
		
		
		
		<!--
		/////////////////////////////////////////////////////////////////////////
		//////////     MAIN SHOW CONTENT     //////////
		//////////////////////////////////////////////////////////////////////
		-->
		<div id="main">
		
				<ol class="breadcrumb">
                    <span id="SiteMapPath1" class="breadcrumb"><a href="#SiteMapPath1_SkipLink" style="position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;">Skip Navigation Links</a><span><a title="MasterRoot">Root</a></span><span> &gt; </span><span><a title="Admin">Anagrafiche</a></span><span> &gt; </span><span>Articoli</span><a id="SiteMapPath1_SkipLink"></a></span>

				</ol>
				<!-- //breadcrumb-->
				
				<div id="content">
				
						<div class="row">
						
								<div class="col-lg-12" >
                                    
    <!-- 
        Sitemap Menu item:
        <siteMapNode url="~/AnagraficaFamiglie.aspx" title="AnagraficaFamiglie" description="AnagraficaFamiglie" image="fa-laptop" id="AnagraficaFamiglie"/>
    -->
    <section class="panel">
	    <header class="panel-heading">
			<h2>Anagrafica Articoli</h2>
		</header>
		<div class="panel-body">

            <!-- PUT YOUR CONTENT HERE -->
                <iframe id='iframeCrud' frameborder="0" style="width:1000px; height:550px; display:none"></iframe>
                <div id="crudDialog" title="" style="display:none"></div>
                <div id="deleteDiv" title="" style="display:none"></div>

                <div class="row">
                    <div class="col-lg-12">
                        <section class="panel">
							<header class="panel-heading">
                            <div ng-app="formlyExample" ng-controller="MainCtrl as vm" name="divContainer" id="div1">
                                <div ng-if="vm.loadingData.$$state.status === 0" style="margin:20px 0;font-size:2em">
                                    <strong>Caricamento...</strong>
                                </div>
                                <div ng-if="vm.loadingData.$$status.state !== 0">
                                    <form ng-submit="vm.onSubmit()" novalidate id="form1">
                                        <formly-form model="vm.model" fields="vm.fields" form="vm.form">
                                        </formly-form>
                                    </form>
                                </div>
                            </div>
							</header>  
                            <div class="panel-body">
                                <span id="ContentPlaceHolder1_JQDTable">
<div id="selectedItemsDialog" title="Elementi Selezionati" style="display:none">
	<div id="selItemsTable">

	</div>
</div><div id="tableJQDTableContainer" style="height:100%;width:100%">

	<table id="tableJQDTable" class="table table-hover table-bordered table-condensed">
		<thead>
			<tr>
				<th>Id</th><th>Magazzino</th><th>Codice</th><th>Descrizione</th><th>U. Misura</th><th>Abilitato</th><th>Tipo</th><th>P. Teorico</th><th>Scorta Min.</th><th>P. Unitario</th><th>Sconto</th><th>IdFornitore</th><th>Actions</th>
			</tr>
		</thead>
		<tbody>

		</tbody>

	</table>

</div>
</span>
                            </div>                      
                        </section>
                    </div>
                </div>
		</div>
	</section>


								</div>
								<!-- //content > row > col-lg-8 -->
								
								
								<!-- //content > row > col-lg-4 -->
								
						</div>
						<!-- //content > row-->
						
				</div>
				<!-- //content-->
				
				
		</div>
		<!-- //main-->
		
		
		
		<!--
		///////////////////////////////////////////////////////////////////
		//////////     MODAL MESSAGES     //////////
		///////////////////////////////////////////////////////////////
		-->
		<div id="md-messages" class="modal fade md-slideUp bg-theme-inverse" tabindex="-1">
				<div class="modal-header bd-theme-inverse-darken">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
						<h4 class="modal-title"><i class="fa fa-inbox"></i> Inbox messages</h4>
				</div>
				<!-- //modal-header-->
				<div class="modal-body" style="padding:0">
				</div>
				<!-- //modal-body-->
		</div>

        <div id="md-messages_yes_no" class="modal fade " tabindex="-1">
				<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
						<h4 class="modal-title"><i class="fa fa-inbox"></i> Confirm</h4>
				</div>
				<!-- //modal-header -->
				<div class="modal-body" style="padding:0">
				</div>
				<!-- //modal-body -->
                <div class="modal-footer">
                    <button type="button" data-dismiss="modal" class="btn btn-primary" id="delete">Delete</button>
                    <button type="button" data-dismiss="modal" class="btn">Cancel</button>
                </div>
                <!-- //modal-footer -->
		</div>

		<div id="md-ajax" class="modal fade" tabindex="-1">
				<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h3>Modal Ajax load</h3>
				</div>
				<div class="modal-body">
				</div>
		</div>
    	<!-- //modal-->
		
		
		
		<!--
		//////////////////////////////////////////////////////////////////////////
		//////////     MODAL NOTIFICATION     //////////
		//////////////////////////////////////////////////////////////////////
		-->

		<!-- //modal-->
		
		
		
		<!--
		//////////////////////////////////////////////////////////////
		//////////     LEFT NAV MENU     //////////
		///////////////////////////////////////////////////////////
		-->
		<nav id="menu"  data-search="close">
            <ul id="MenuBuilder" class=""><li><a href="/Home.aspx"><i class="icon  fa fa-home"></i> Home</a></li><li><span><i class="icon  fa fa-desktop"></i> Anagrafiche</span><ul><li><a href="/Anagrafiche/AnagraficaArticoli.aspx"><i class="icon  fa fa-laptop"></i> Articoli</a></li><li><a href="/Anagrafiche/Customers.aspx"><i class="icon  fa fa-laptop"></i> Magazzini</a></li><li><a href="/Anagrafiche/UnitaDiMisura.aspx"><i class="icon  fa fa-thumb-tack"></i> Unita Di Misura</a></li><li><a href="/Anagrafiche/TipologiaArticolo.aspx"><i class="icon  fa fa-laptop"></i> Tipologia Articolo</a></li><li><a href="/Anagrafiche/TipoOperazione.aspx"><i class="icon  fa fa-laptop"></i> Tipo Operazione</a></li><li><a href="/Anagrafiche/TipoMovimento.aspx"><i class="icon  fa fa-laptop"></i> Tipo Movimento</a></li><li><a href="/Anagrafiche/Fornitori.aspx"><i class="icon  fa fa-laptop"></i> Fornitori</a></li><li><a href="/Anagrafiche/UsersForCustomers.aspx"><i class="icon  fa fa-laptop"></i> Operatori Cliente</a></li></ul></li><li><span><i class="icon  fa fa-dashboard"></i> Operazioni</span><ul><li><a href="/Operazioni/CronologiaMovimenti.aspx"><i class="icon  fa fa-exchange"></i> Cronologia Movimenti</a></li><li><a href="/Operazioni/ReportMagazzino.aspx"><i class="icon  fa fa-archive"></i> Report Magazzino</a></li><li><a href="/Authentication/NewAccount2.aspx"><i class="icon  fa fa-user"></i> Nuovo Account</a></li><li><a href="/Operazioni/NuovoFCD2cs.aspx"><i class="icon  fa fa-laptop"></i> Carico Magazzino</a></li><li><a href="/Operazioni/MovimentoScarico.aspx"><i class="icon  fa fa-laptop"></i> Scarico Magazzino</a></li></ul></li><li><span><i class="icon  fa fa-user"></i> Admin</span><ul><li><a href="/admin/access/Users.aspx"><i class="icon  fa fa-laptop"></i> Elenco Utenti</a></li><li><a href="/admin/access/Locked_Users.aspx"><i class="icon  fa fa-laptop"></i> Utenti Bloccati</a></li><li><a href="/admin/access/Online_Users.aspx"><i class="icon  fa fa-laptop"></i> Utenti Online</a></li><li><a href="/admin/access/Assign_Roles.aspx"><i class="icon  fa fa fa-laptop"></i> Assegnazione Ruoli</a></li><li><a href="/admin/access/RolesManager.aspx"><i class="icon  fa fa fa-laptop"></i> Gestione Ruoli</a></li><li><span><i class="icon  fa fa-user"></i> Gestione Password</span><ul><li><a href="/Authentication/ChangePassword.aspx"><i class="icon  fa fa-laptop"></i> Change Password</a></li><li><a href="/Authentication/ResetPassword.aspx"><i class="icon  fa fa-laptop"></i> Reset Password</a></li></ul></li></ul></li></ul>
		</nav>
		<!-- //nav left menu-->
		
		
		
		<!--
		/////////////////////////////////////////////////////////////////
		//////////     RIGHT NAV MENU     //////////
		/////////////////////////////////////////////////////////////
		-->

		<!-- //nav right menu-->
		
		
</div>
<!-- //wrapper-->

<!--
////////////////////////////////////////////////////////////////////////
//////////     JAVASCRIPT  LIBRARY     //////////
/////////////////////////////////////////////////////////////////////
-->
		
<!-- Jquery Library -->








<script type="text/javascript" src="/assets/plugins/bootstrap/bootstrap.min.js"></script>
<!-- Modernizr Library For HTML5 And CSS3 -->
<script type="text/javascript" src="/assets/js/modernizr/modernizr.js"></script>
<script type="text/javascript" src="/assets/plugins/mmenu/jquery.mmenu.js"></script>
<script type="text/javascript" src="/assets/js/styleswitch.js"></script>
<!-- Library 10+ Form plugins-->
<script type="text/javascript" src="/assets/plugins/form/form.js"></script>
<!-- Datetime plugins -->
<script type="text/javascript" src="/assets/plugins/datetime/datetime.js"></script>
<!-- Library Chart-->
<script type="text/javascript" src="/assets/plugins/chart/chart.js"></script>
<!-- Library  5+ plugins for bootstrap -->
<script type="text/javascript" src="/assets/plugins/pluginsForBS/pluginsForBS.js"></script>
<!-- Library 10+ miscellaneous plugins -->
<script type="text/javascript" src="/assets/plugins/miscellaneous/miscellaneous.js"></script>
<!-- Library Themes Customize-->
<script type="text/javascript" src="/assets/js/caplet.custom.js"></script>



    
    <script>
        var m_tableJQDTable;
        var rows_selected_JQDTable = [];

        $(document).ready(function () {
            m_tableJQDTable = $('#tableJQDTable').DataTable({
                "processing": true
        , "serverSide": true
        , "deferLoading": 0
        , "searching": true
        , "autoWitdh": true
        , "scrollY": 500
        , "scrollCollapse": true
        , "lengthChange": true
        , "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
        , "paging": true
        , "pageLength": 20
        , "pagingType": "full_numbers"

                 , "ajax": {
                     "type": "POST",
                     "url": "/api/AnagraficaArticoli/LoadArticolimagazzino",
                     "data": function (data) {
                         data.Customer = $('#formly_1_asyncselect_selMagazzini_0').val();
                     }
                 }

                 , "columns": [
        { "data": "Id", "type": "string", "visible": false },
        { "data": "DescrCliente", "type": "string" },
        { "data": "Codice", "type": "string" },
        { "data": "Descrizione", "type": "string" },
        { "data": "DescrUnitaDiMisura", "type": "string" },
        { "data": "IsAbilitato", "type": "string" },
        { "data": "DescrTipologia", "type": "string" },
        { "data": "PesoTeorico", "type": "string" },
        { "data": "ScortaMinima", "type": "string" },
        { "data": "PrezzoUnitario", "type": "string" },
        { "data": "ScontoFornitore", "type": "string" },
        { "data": "Fornitore", "type": "string", "visible": false },
        {
            "data": null,
            "orderable": false,
            "render": function (data, type, row) {
                return "<i class=' fa fa-search' onclick='ShowImage(" + row.Id + ")' style='cursor: pointer;'></i> "
            }
        }

                 ]


                 , buttons: [
        {
            text: 'Carica',
            className: 'sButtonCarica',
            action: function (e, dt, node, config) {
                var elements = $('#').prop('elements');
                if (elements != undefined) {
                    var index1 = 0;
                    $.each(elements, function (i, o) {
                        if ($(o).prop('id') !== '') {
                            index1++;
                        }
                    });
                    var index2 = 0;
                    $.each(elements, function (i, o) {
                        if ($(o).hasClass('ng-valid')) {
                            index2++;
                        }
                    });
                    if (index1 != index2) { alert('Inserire i parametri'); } else { javascript: RedrawGrid(m_tableJQDTable) }
                } else { javascript: RedrawGrid(m_tableJQDTable); }
            }
        },
        {
            text: 'Aggiungi', className: 'sAggiungi', action: function (e, dt, node, config) {
                LoadAddDialog();
            }
        },
        {
            text: 'Modifica', className: 'sModifica', action: function (e, dt, node, config) {
                LoadEditDialog();
            }
        },
        {
            text: 'Cancella', className: 'sCancella', action: function (e, dt, node, config) {
                DeleteDialog();
            }
        },
                 ]


                 , dom: 'Bflrtip',
            });

            yadcf.init(m_tableJQDTable, [
        { column_number: 1, filter_type: "text" },
        { column_number: 2, filter_type: "text" },
            ]);


            $('#tableJQDTable tbody').on('click', 'tr', function () {
                if ($(this).hasClass('active')) {
                    $(this).removeClass('active');
                }
                else {
                    m_tableJQDTable.$('tr.active').removeClass('active');
                    $(this).addClass('active');
                }
            });





        });
</script>


<script>
    $(document).ready(function () {
        // BOOTSTRAP: Tweaks
        $('.yadcf-filter-wrapper').addClass('input-group');
        $('.yadcf-filter, .yadcf-filter-date', this).addClass('form-control input-sm');
        $('.yadcf-filter-reset-button', this).addClass('btn btn-default btn-sm').wrap('<span class="input-group-btn"></span>');
    });

    var settings = new FormlySettings();
    settings.container = '#divFormly';
    settings.setLoad(settings.createGetConfig('/api/AnagraficaArticoli/LoadCustomersFields'));
    FormlyManager(settings);

    function ShowImage(obj) {
        alert('mostra immagine');
    }

    function CloseDialog(response) {
        $('#crudDialog').dialog('close');

        ShowResponseMessage(response);
    }

    function LoadAddDialog() {

        var m_id_magazzino = $('#formly_1_asyncselect_selMagazzini_0').val();
        m_id_magazzino = m_id_magazzino.replace('string:', '');

        $("#iframeCrud").prop('src', 'AnagraficaArticoli_CRUD.aspx?idMg=' + m_id_magazzino).appendTo("#crudDialog");
        $("#iframeCrud").show();

        m_dialog = $("#crudDialog").dialog({
            title: 'Anagrafica Articoli',
            width: 'auto',
            height: 'auto',
            modal: true,
            close: function () {
                RedrawGrid(m_tableJQDTable);

                $("#iframeCrud").contents().remove();
                $('#iframeCrud').hide();
            }
        });
    }

    function LoadEditDialog() {

        var p = null;
        p = GetSelectedData(m_tableJQDTable).Id;

        var m_id_magazzino = $('#formly_1_asyncselect_selMagazzini_0').val();
        m_id_magazzino = m_id_magazzino.replace('string:', '');

        var url = 'AnagraficaArticoli_CRUD.aspx?id=' + p + '&idMg=' + m_id_magazzino;

        $("#iframeCrud").prop('src', url).appendTo("#crudDialog");
        $("#iframeCrud").show();

        m_dialog = $("#crudDialog").dialog({
            title: 'Anagrafica Articoli',
            width: 'auto',
            height: 'auto',
            modal: true,
            close: function () {
                RedrawGrid(m_tableJQDTable);

                $("#iframeCrud").contents().remove();
                $('#iframeCrud').hide();
            }
        });
    }

    function DeleteDialog() {
        var p = null;

        var row = GetSelectedData(m_tableJQDTable);

        p = row.Id;
        p1 = row.Fornitore;

        var url = '/api/AnagraficaArticoli/Delete';

        $("#deleteDiv").contents().remove();
        $("#deleteDiv").html("Confermi la cancellazione dell'elemento con codice: " + p + " ?").appendTo("#crudDialog");
        //$("#crudDialog").html("Confermi la cancellazione dell'elemento con codice: " + p + " ?");
        $("#deleteDiv").show();

        // Define the Dialog and its properties.
        $("#crudDialog").dialog({
            resizable: false,
            modal: true,
            title: "Cancella elemento",
            height: 250,
            width: 400,
            buttons: {
                "Yes": function () {
                    $(this).dialog("option", { buttons: {} });
                    //$(this).empty();
                    $(this).dialog('close');

                    $.ajax({
                        type: "POST",
                        url: url,
                        data: JSON.stringify({ id: p, idF: p1 }),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (response) {
                            RedrawGrid(m_tableJQDTable);

                            //$("#crudDialog").html('');
                            $("#deleteDiv").contents().remove();
                            $('#deleteDiv').hide();

                            alert(response);
                        },
                        failure: function (response) {

                            //$("#crudDialog").empty();
                            $("#deleteDiv").contents().remove();
                            $('#deleteDiv').hide();

                            alert(response);
                        }
                    });
                },
                "No": function () {
                    //$("#crudDialog").empty();
                    $("#deleteDiv").contents().remove();
                    $('#deleteDiv').hide();

                    $(this).dialog('close');
                }
            }
        });
    }
</script>


    <script type="text/javascript">
        function Logout() {
            $.ajax({
                type: "POST",
                url: '/api/Authentication/LogOut',
                data: null,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    $.notific8('User Logout !', { life: 5000, horizontalEdge: "bottom", theme: "success", heading: "Information" });

                    setTimeout("window.location.href='http://localhost:2482/Authentication/login.aspx'", 500);
                },
                failure: function (response) {

                }
            });
        }
    </script>
</body>
</html>

